--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
android/gradlew v4.4.0-rc.3 (0115fa43) Text, 8.53 KB
T8b949e#!/bin/sh
T8b949e#
T8b949e# Copyright © 2015-2021 the original authors.
T8b949e#
T8b949e# Licensed under the Apache License, Version 2.0 (the "License");
T8b949e# you may not use this file except in compliance with the License.
T8b949e# You may obtain a copy of the License at
T8b949e#
T8b949e# https://www.apache.org/licenses/LICENSE-2.0
T8b949e#
T8b949e# Unless required by applicable law or agreed to in writing, software
T8b949e# distributed under the License is distributed on an "AS IS" BASIS,
T8b949e# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
T8b949e# See the License for the specific language governing permissions and
T8b949e# limitations under the License.
T8b949e#
T8b949e##############################################################################
T8b949e#
T8b949e# Gradle start up script for POSIX generated by Gradle.
T8b949e#
T8b949e# Important for running:
T8b949e#
T8b949e# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
T8b949e# noncompliant, but you have some other compliant shell such as ksh or
T8b949e# bash, then to run this script, type that shell name before the whole
T8b949e# command line, like:
T8b949e#
T8b949e# ksh Gradle
T8b949e#
T8b949e# Busybox and similar reduced shells will NOT work, because this script
T8b949e# requires all of these POSIX shell features:
T8b949e# * functions;
T8b949e# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
T8b949e# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
T8b949e# * compound commands having a testable exit status, especially «case»;
T8b949e# * various built-in commands including «command», «set», and «ulimit».
T8b949e#
T8b949e# Important for patching:
T8b949e#
T8b949e# (2) This script targets any POSIX shell, so it avoids extensions provided
T8b949e# by Bash, Ksh, etc; in particular arrays are avoided.
T8b949e#
T8b949e# The "traditional" practice of packing multiple parameters into a
T8b949e# space-separated string is a well documented source of bugs and security
T8b949e# problems, so this is (mostly) avoided, by progressively accumulating
T8b949e# options in "$@", and eventually passing that to Java.
T8b949e#
T8b949e# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
T8b949e# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
T8b949e# see the in-line comments for details.
T8b949e#
T8b949e# There are tweaks for specific operating systems such as AIX, CygWin,
T8b949e# Darwin, MinGW, and NonStop.
T8b949e#
T8b949e# (3) This script is generated from the Groovy template
T8b949e# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
T8b949e# within the Gradle project.
T8b949e#
T8b949e# You can find Gradle at https://github.com/gradle/gradle/.
T8b949e#
T8b949e##############################################################################
T8b949e# Attempt to set APP_HOME
T8b949e# Resolve links: $0 may be a link
Te6edf3app_pathTff7b72=Te6edf3$0
T8b949e# Need this for daisy-chained symlinks.
Tff7b72while
Te6edf3APP_HOMETff7b72=Tffd700${Te6edf3app_pathTb4b4b4%Ta5d6ff"Tffd700${Te6edf3app_pathTb4b4b4##*/Tffd700}Ta5d6ff"Tffd700} T8b949e# leaves a trailing /; empty if no leading path
Tff7b72[ -h Ta5d6ff"Te6edf3$app_pathTa5d6ff" Tff7b72]
Tff7b72do
Te6edf3lsTff7b72=Tff7b72$( ls -ld Ta5d6ff"Te6edf3$app_pathTa5d6ff" Tff7b72)
Te6edf3linkTff7b72=Tffd700${Te6edf3lsTb4b4b4#*Ta5d6ff' -> 'Tffd700}
Tff7b72case Te6edf3$link Tff7b72in T8b949e#(
/*Tff7b72) Te6edf3app_pathTff7b72=Te6edf3$link Tb4b4b4;Tb4b4b4; T8b949e#(
*Tff7b72) Te6edf3app_pathTff7b72=Te6edf3$APP_HOMETe6edf3$link Tb4b4b4;Tb4b4b4;
Tff7b72esac
Tff7b72done
T8b949e# This is normally unused
T8b949e# shellcheck disable=SC2034
Te6edf3APP_BASE_NAMETff7b72=Tffd700${Te6edf30Tb4b4b4##*/Tffd700}
Te6edf3APP_HOMETff7b72=Tff7b72$( Tffa657cd Ta5d6ff"Tffd700${Te6edf3APP_HOMETff7b72:-Tb4b4b4./Tffd700}Ta5d6ff" Tff7b72&& Tffa657pwd -P Tff7b72) Tff7b72|| Tffa657exit
T8b949e# Use the maximum available, or set MAX_FD != -1 to use that value.
Te6edf3MAX_FDTff7b72=maximum
warn Tff7b72(Tff7b72) Tff7b72{
Tffa657echo Ta5d6ff"Te6edf3$*Ta5d6ff"
Tff7b72} >Tb4b4b4&T79c0ff2
die Tff7b72(Tff7b72) Tff7b72{
Tffa657echo
Tffa657echo Ta5d6ff"Te6edf3$*Ta5d6ff"
Tffa657echo
Tffa657exit T79c0ff1
Tff7b72} >Tb4b4b4&T79c0ff2
T8b949e# OS specific support (must be 'true' or 'false').
Te6edf3cygwinTff7b72=Tffa657false
Te6edf3msysTff7b72=Tffa657false
Te6edf3darwinTff7b72=Tffa657false
Te6edf3nonstopTff7b72=Tffa657false
Tff7b72case Ta5d6ff"Tff7b72$( uname Tff7b72)Ta5d6ff" Tff7b72in T8b949e#(
CYGWIN* Tff7b72) Te6edf3cygwinTff7b72=Tffa657true Tb4b4b4;Tb4b4b4; T8b949e#(
Darwin* Tff7b72) Te6edf3darwinTff7b72=Tffa657true Tb4b4b4;Tb4b4b4; T8b949e#(
MSYS* Tb4b4b4| MINGW* Tff7b72) Te6edf3msysTff7b72=Tffa657true Tb4b4b4;Tb4b4b4; T8b949e#(
NONSTOP* Tff7b72) Te6edf3nonstopTff7b72=Tffa657true Tb4b4b4;Tb4b4b4;
Tff7b72esac
Te6edf3CLASSPATHTff7b72=Te6edf3$APP_HOME/gradle/wrapper/gradle-wrapper.jar
T8b949e# Determine the Java command to use to start the JVM.
Tff7b72if Tff7b72[ -n Ta5d6ff"Te6edf3$JAVA_HOMETa5d6ff" Tff7b72] Tb4b4b4; Tff7b72then
Tff7b72if Tff7b72[ -x Ta5d6ff"Te6edf3$JAVA_HOMETa5d6ff/jre/sh/javaTa5d6ff" Tff7b72] Tb4b4b4; Tff7b72then
T8b949e# IBM's JDK on AIX uses strange locations for the executables
Te6edf3JAVACMDTff7b72=Te6edf3$JAVA_HOME/jre/sh/java
Tff7b72else
Te6edf3JAVACMDTff7b72=Te6edf3$JAVA_HOME/bin/java
Tff7b72fi
Tff7b72if Tff7b72[ ! -x Ta5d6ff"Te6edf3$JAVACMDTa5d6ff" Tff7b72] Tb4b4b4; Tff7b72then
die Ta5d6ff"Ta5d6ffERROR: JAVA_HOME is set to an invalid directory: Te6edf3$JAVA_HOME
Ta5d6ff
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.Ta5d6ff"
Tff7b72fi
Tff7b72else
Te6edf3JAVACMDTff7b72=java
Tff7b72if ! Tffa657command -v java >/dev/null T79c0ff2>Tb4b4b4&T79c0ff1
Tff7b72then
die Ta5d6ff"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
Tff7b72fi
Tff7b72fi
T8b949e# Increase the maximum file descriptors if we can.
Tff7b72if ! Ta5d6ff"Te6edf3$cygwinTa5d6ff" Tff7b72&& ! Ta5d6ff"Te6edf3$darwinTa5d6ff" Tff7b72&& ! Ta5d6ff"Te6edf3$nonstopTa5d6ff" Tb4b4b4; Tff7b72then
Tff7b72case Te6edf3$MAX_FD Tff7b72in T8b949e#(
max*Tff7b72)
T8b949e# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
T8b949e# shellcheck disable=SC3045
Te6edf3MAX_FDTff7b72=Tff7b72$( Tffa657ulimit -H -n Tff7b72) Tff7b72||
warn Ta5d6ff"Could not query maximum file descriptor limit"
Tff7b72esac
Tff7b72case Te6edf3$MAX_FD Tff7b72in T8b949e#(
Ta5d6ff'' Tb4b4b4| softTff7b72) :Tb4b4b4;Tb4b4b4; T8b949e#(
*Tff7b72)
T8b949e# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
T8b949e# shellcheck disable=SC3045
Tffa657ulimit -n Ta5d6ff"Te6edf3$MAX_FDTa5d6ff" Tff7b72||
warn Ta5d6ff"Ta5d6ffCould not set maximum file descriptor limit to Te6edf3$MAX_FDTa5d6ff"
Tff7b72esac
Tff7b72fi
T8b949e# Collect all arguments for the java command, stacking in reverse order:
T8b949e# * args from the command line
T8b949e# * the main class name
T8b949e# * -classpath
T8b949e# * -D...appname settings
T8b949e# * --module-path (only if needed)
T8b949e# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
T8b949e# For Cygwin or MSYS, switch paths to Windows format before running java
Tff7b72if Ta5d6ff"Te6edf3$cygwinTa5d6ff" Tff7b72|| Ta5d6ff"Te6edf3$msysTa5d6ff" Tb4b4b4; Tff7b72then
Te6edf3APP_HOMETff7b72=Tff7b72$( cygpath --path --mixed Ta5d6ff"Te6edf3$APP_HOMETa5d6ff" Tff7b72)
Te6edf3CLASSPATHTff7b72=Tff7b72$( cygpath --path --mixed Ta5d6ff"Te6edf3$CLASSPATHTa5d6ff" Tff7b72)
Te6edf3JAVACMDTff7b72=Tff7b72$( cygpath --unix Ta5d6ff"Te6edf3$JAVACMDTa5d6ff" Tff7b72)
T8b949e# Now convert the arguments - kludge to limit ourselves to /bin/sh
Tff7b72for arg Tff7b72do
Tff7b72if
Tff7b72case Te6edf3$arg Tff7b72in T8b949e#(
-*Tff7b72) Tffa657false Tb4b4b4;Tb4b4b4; T8b949e# don't mess with options #(
/?*Tff7b72) Te6edf3tTff7b72=Tffd700${Te6edf3argTb4b4b4#/Tffd700} Te6edf3tTff7b72=/Tffd700${Te6edf3tTb4b4b4%%/*Tffd700} T8b949e# looks like a POSIX filepath
Tff7b72[ -e Ta5d6ff"Te6edf3$tTa5d6ff" Tff7b72] Tb4b4b4;Tb4b4b4; T8b949e#(
*Tff7b72) Tffa657false Tb4b4b4;Tb4b4b4;
Tff7b72esac
Tff7b72then
Te6edf3argTff7b72=Tff7b72$( cygpath --path --ignore --mixed Ta5d6ff"Te6edf3$argTa5d6ff" Tff7b72)
Tff7b72fi
T8b949e# Roll the args list around exactly as many times as the number of
T8b949e# args, so each arg winds up back in the position where it started, but
T8b949e# possibly modified.
T8b949e#
T8b949e# NB: a `for` loop captures its iteration list before it begins, so
T8b949e# changing the positional parameters here affects neither the number of
T8b949e# iterations, nor the values presented in `arg`.
Tffa657shift T8b949e# remove old arg
Tffa657set -- Ta5d6ff"Te6edf3$@Ta5d6ff" Ta5d6ff"Te6edf3$argTa5d6ff" T8b949e# push replacement arg
Tff7b72done
Tff7b72fi
T8b949e# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
Te6edf3DEFAULT_JVM_OPTSTff7b72=Ta5d6ff'"-Xmx64m" "-Xms64m"'
T8b949e# Collect all arguments for the java command;
T8b949e# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
T8b949e# shell script including quotes and variable substitutions, so put them in
T8b949e# double quotes to make sure that they get re-expanded; and
T8b949e# * put everything else in single quotes, so that it's not re-expanded.
Tffa657set -- Tffea00\
Ta5d6ff"Ta5d6ff-Dorg.gradle.appname=Te6edf3$APP_BASE_NAMETa5d6ff" Tffea00\
-classpath Ta5d6ff"Te6edf3$CLASSPATHTa5d6ff" Tffea00\
org.gradle.wrapper.GradleWrapperMain Tffea00\
Ta5d6ff"Te6edf3$@Ta5d6ff"
T8b949e# Stop when "xargs" is not available.
Tff7b72if ! Tffa657command -v xargs >/dev/null T79c0ff2>Tb4b4b4&T79c0ff1
Tff7b72then
die Ta5d6ff"xargs is not available"
Tff7b72fi
T8b949e# Use "xargs" to parse quoted args.
T8b949e#
T8b949e# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
T8b949e#
T8b949e# In Bash we could simply go:
T8b949e#
T8b949e# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
T8b949e# set -- "${ARGS[@]}" "$@"
T8b949e#
T8b949e# but POSIX shell has neither arrays nor command substitution, so instead we
T8b949e# post-process each arg (as a line of input to sed) to backslash-escape any
T8b949e# character that might be a shell metacharacter, then use eval to reverse
T8b949e# that process (while maintaining the separation between arguments), and wrap
T8b949e# the whole thing up as a single "set" statement.
T8b949e#
T8b949e# This will of course break if any of these variables contains a newline or
T8b949e# an unmatched quote.
T8b949e#
Tffa657eval Ta5d6ff"Ta5d6ffset -- Tff7b72$(
Tffa657printf Ta5d6ff'%s\n' Ta5d6ff"Te6edf3$DEFAULT_JVM_OPTSTa5d6ff Te6edf3$JAVA_OPTSTa5d6ff Te6edf3$GRADLE_OPTSTa5d6ff" Tb4b4b4|
xargs -n1 Tb4b4b4|
sed Ta5d6ff' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' Tb4b4b4|
tr Ta5d6ff'\n' Ta5d6ff' '
Tff7b72)Ta5d6ff" Ta5d6ff'"$@"'
Tffa657exec Ta5d6ff"Te6edf3$JAVACMDTa5d6ff" Ta5d6ff"Te6edf3$@Ta5d6ff"
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────